<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="pragma" content="no-cache"> 
<meta http-equiv="cache-control" content="no-cache, must-revalidate"> 
<meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
<title>Customer Login</title>
<script src="${pageContext.request.contextPath}/script/jQuery1.8.2.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/script/formcheck.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
	$("#btnSb").click(function(){
		if(validateRequiredFields($("#loginform")[0])==true){
			var url="${pageContext.request.contextPath}/customer/process.do?action=login&tmp="+Math.floor(Math.random() * 100);
			$("#loginform").attr("action",url);
			$("#loginform").submit();
		}
	});
});
</script>
</head>
<body>
	<h1>Please login...</h1>
	<a href="${pageContext.request.contextPath}/">Back to index</a>
	<div style="color:red;">
		${error}
	</div>
	<div style="color:blue;">
		${info}
	</div>
	<form id="loginform" method="post">
		<table>
			<tr>
				<td>Customer Name:</td>
				<td><input type="text" name="name" alt="Customer Name#true"/></td>
			</tr>
			<tr>
				<td>Password:</td>
				<td><input type="password" name="password" alt="Password#true"/></td>
			</tr>
			<tr>
				<td>Validate Code:</td>
				<td><input type="text" name="code" alt="Validate Code#true" style="width:80px;"/><img
					id="codeImg" src="${pageContext.request.contextPath}/resource/code.do" alt="click me"/></td>
			</tr>
			<tr>
				<td><input id="btnSb" type="button" value="Submit"/><input type="reset" value="Reset"/></td>
			</tr>
		</table>
	</form>
</body>
</html>